﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Library.TestServices;
using Microsoft.AspNetCore.Mvc;

namespace MvcMovie.Controllers
{
    public class DIController : Controller
    {
        private readonly ITestService4 _testService4;

        public DIController(ITestService4 testService4)
        {
            _testService4 = testService4;

        }

        //这里采用了Action注入的方法

        public IActionResult Index()
        {
            ViewBag._testService4 = _testService4.MyProperty;
            return View();
        }
    }
}